package com.hzncc.flowable_diboot.vo;

import com.diboot.core.binding.annotation.*;
import com.diboot.core.vo.FileVO;
import com.diboot.core.vo.LabelValue;
import com.diboot.iam.entity.IamOrg;
import com.diboot.iam.entity.IamPosition;
import com.diboot.iam.entity.IamRole;
import com.diboot.iam.entity.IamUser;
import com.diboot.file.entity.FileRecord;
import com.diboot.tenant.entity.IamTenant;
import com.hzncc.flowable_diboot.entity.CustomConnector;
import com.hzncc.flowable_diboot.entity.Customer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;
/**
* 客户联系人 VO定义
* @author MyName
* @version 1.0
* @date 2024-05-30
* Copyright © MyCorp
*/
@Getter @Setter @Accessors(chain = true)
public class CustomConnectorListVO extends CustomConnector  {
private static final long serialVersionUID = 1790979456675716123L;
    /**
    * 客户名称 关联信息
    */

    @BindField(
        entity = Customer.class,
        field = "name",
        condition = "this.customer_id = id"
     )
    private String customerIdLabel;

    /**
    * 负责人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.user_id = id"
     )
    private String userIdLabel;

    /**
    * 所属部门 关联信息
    */

    @BindField(
        entity = IamOrg.class,
        field = "name",
       condition = "this.userId = dbt_iam_user.id and dbt_iam_user.org_id = id"
     )
    private String dept;

    /**
    * 性别 关联字典选项
    */
    @BindDict(
    type = "GENDER",
    field = "gender"
    )
    private LabelValue genderLabel;

    /**
    * 创建人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.create_by = id"
     )
    private String createByLabel;

    /**
    * 更新人 关联信息
    */

    @BindField(
        entity = IamUser.class,
        field = "realname",
        condition = "this.update_by = id"
     )
    private String updateByLabel;

    /**
     * 是否关注
     */
    private Boolean isStar;
}